/****************************************************************************
*
*					Functions of class ParameterLearningFactory
*
****************************************************************************/

#include "ParameterLearningFactory.h"
#include "AllParameterLearningClasses.h"


/****************************************************************************
*					ParameterLearningFactory::ParameterLearningFactory
*
*	Description:	Standard constructor with initialization of internal parameters
*	Parameters:		-
*	Returns:		-
*
****************************************************************************/
ParameterLearningFactory::ParameterLearningFactory (void) {
	
}


/****************************************************************************
*					ParameterLearningFactory::~ParameterLearningFactory
*
*	Description:	Standard destructor with removing all dynamic internal variables
*	Parameters:		-
*	Returns:		-
*
****************************************************************************/
ParameterLearningFactory::~ParameterLearningFactory (void) {
	
}


/****************************************************************************
*					ParameterLearningFactory::createObjectByID
*
*	Description:	Function creates object of ancestor class ParameterLearning
*					of a subclass with a given ID
*	Parameters:		id - identificator of subclass of class ParameterLearning
*	Returns:		ParameterLearning* - new dynamic object of subclass of 
*						ParameterLearning with the given ID
*
****************************************************************************/
ParameterLearning* ParameterLearningFactory::createObjectByID(const signed int id) {
	// Dummy
	return NULL;
}


/****************************************************************************
*					ParameterLearningFactory::createObjectByName
*
*	Description:	Function creates object of ancestor class ParameterLearning
*					of a subclass with a given name
*	Parameters:		name - name of the desired subclass of class ParameterLearning
*	Returns:		ParameterLearning* - new dynamic object of subclass of 
*						ParameterLearning with the given name
*
****************************************************************************/
ParameterLearning* ParameterLearningFactory::createObjectByName(const std::string name) {
	ParameterLearning* plClass = NULL;
	// Transforming to lowercase
	std::string nameStr (name);
	std::transform(nameStr.begin(), nameStr.end(), nameStr.begin(), ::tolower);
	// Comparing the names
	if (strcmp (nameStr.c_str(), "simple") == 0) {
		plClass = new SimpleParameterLearning();
	}
	// Returning the value
	return plClass;
}
